package api;

public class test2 {
    public static void main(String[] args) {
        //判断水仙花数
        int count = 0;
        int i = 0;

        for(i = 100;i<1000;i++)
        {
            int hundred = i/100;
            int ten = i/10%10;
            int one = i%10;

            if(i == Math.pow(hundred,3)+Math.pow(ten,3)+Math.pow(one,3))
            {
                System.out.println(i);
                count++;
            }
        }
        System.out.println("一共有" + count + "个水仙花数");
    }
}
